package com.smarthome.domain.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 
* @ClassName: SexEnum
* @Description: TODO(性别枚举)
* @author cyj
* @date 2015年9月16日 下午11:23:51
*
 */
public enum SexEnum {
	FEMALE(0,"女"),MALE(1,"男");
	
	private int code;
    private String name;

    private static Map<Integer,String> sexMap = new HashMap<Integer,String>();
    private SexEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    static{
    	for(SexEnum s : SexEnum.values()){
    		sexMap.put(s.getCode(),s.getName());
    	}
    }
    
    public static String getNameByCode(Integer code){
    	return  sexMap.get(code);
    }
    
    
    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
    
}
